{include file="common/top" /}
<style>
html{
	background: #ffffff;
}
</style>
<form class="layui-form " action="" style="    background: #fff;">
	<div class="layui-form-item">
		<label class="layui-form-label">客户名称：</label>
		<div class="layui-col-xs6">
			<select name="id" lay-verify="required" lay-search=""  lay-verify="required" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="cus_list" id='cu'}
					<option value="{$cu.id}" >{$cu.name}</option>
				{/volist}
	        </select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">账户名称：</label>
		<div class="layui-col-xs6">
			<select name="acc_id" lay-verify="required" lay-search=""  lay-verify="required" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="acc_list" id='ac'}
					<option value="{$ac.id}" >名称：{$ac.name}，资质：{$ac.cert}</option>
				{/volist}
	        </select>
		</div>
	</div>
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden" name="id" value="{$Request.get.cu_id}"  >
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">开通</button>
		</div>
	</div>
	
</form>
{include file="common/footer" /}
<script>
	layui.use(['form', 'layedit', 'laydate'], function(){
		  var form = layui.form ,layer = layui.layer;
		  
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('open_account')}",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_s(data['msg']);

				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			
			return false;
		  });
		 
		});
	
</script>
